import request from '@/utils/request'

// 查询镜像列表
export function listImage (query) {
  return request({
    url: '/dockerinsight/image/list',
    method: 'get',
    params: query
  })
}

// 启动镜像
export function startImage (data) {
  return request({
    url: '/dockerinsight/image/startImage',
    method: 'post',
    data: data
  })
}

// 导出镜像
export function exportImageData (query) {
  return request({
    url: '/dockerinsight/image/exportImage',
    method: 'get',
    params: query
  })
}

// 移除镜像
export function removeImage (data) {
  return request({
    url: '/dockerinsight/image/removeImage',
    method: 'post',
    data: data
  })
}

// 查询镜像详细
export function getImage (id) {
  return request({
    url: '/dockerinsight/image/' + id,
    method: 'get'
  })
}

// 新增镜像
export function addImage (data) {
  return request({
    url: '/dockerinsight/image',
    method: 'post',
    data: data
  })
}

// 修改镜像
export function updateImage (data) {
  return request({
    url: '/dockerinsight/image',
    method: 'put',
    data: data
  })
}

// 删除镜像
export function delImage (id) {
  return request({
    url: '/dockerinsight/image/' + id,
    method: 'delete'
  })
}

// 导出镜像
export function exportImage (query) {
  return request({
    url: '/dockerinsight/image/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/dockerinsight/image/getInitData/' + dictTypes,
    method: 'get'
  })
}
